package mk.com.ldm.corepoint.implementation.client.lib.custom.cpstable;

import java.util.ArrayList;
import java.util.HashMap;

public class ListRow {
	private HashMap<String, String> map = new HashMap<String, String>();
	private ArrayList<String> array = new ArrayList<String>();
	
	public ListRow(){}
	
	public ListRow(HashMap<String, String> map, ArrayList<String> array){
		this.map = map;
		this.array = array;
	}
	
	public ListRow(HashMap<String, String> map){
		this.map = map;
	}
	
	public ListRow(ArrayList<String> array){
		this.array = array;
	}
	
	public void put(String key, String value){
		map.put(key, value);
	}
	
	/**
	 * Remove object from map
	 * @param key
	 */
	public void remove(String key){
		map.remove(key);
	}
	
	/**
	 * Gets the value from map
	 * @param key
	 * @return String value
	 */
	public String get(String key){
		return map.get(key);
	}
	
	public void setMap(HashMap<String, String> map){
		this.map = map;
	}
	
	public HashMap<String, String> getMap(){
		return map;
	}
	
	public void add(String value){
		array.add(value);
	}
	
	/**
	 * Remove value from the array by index
	 * @param index
	 */
	public void remove(int index){
		array.remove(index);
	}
	
	/**
	 * Remove value from the array by value
	 * @param value
	 */
	public void removeFromArray(String value){
		array.remove(value);
	}
	
	/**
	 * Gets the value from array
	 * @param index
	 * @return String value
	 */
	public String get(int index){
		return array.get(index);
	}
	
	public void setArray(ArrayList<String> array){
		this.array = array;
	}
	
	public ArrayList<String> getArray(){
		return array;
	}
}

